<?php

	// +----------------------------------------------------------------------
	// | 用户经验记录
	// +----------------------------------------------------------------------
	// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
	// +----------------------------------------------------------------------
	// | Author: 微尘 <yicmf@qq.com>
	// +----------------------------------------------------------------------

	namespace app\model\ucenter;

	use app\model\ucenter\UserGrade as UserGradeModel;

	class UserExperience extends Common
	{

		public function user()
		{
			return $this->belongsTo(User::class);
		}

		/**
		 * 写入修改
		 * @param $data
		 */
		public static function onBeforeInsert($data)
		{
			$data['status'] = 1;
			$data['ip'] = request()->ip();
		}


		protected function setIpAttr()
		{
			return self::$request->ip();
		}

	}
